#include <QtCore/QCoreApplication>
#include <memory>
#include <tr1/memory>
#include <iostream>
using namespace std;


class test
{
public:
   void print() {std::cout << "test::print" << std::endl;}
};


int main(int argc, char *argv[])
{
   QCoreApplication a(argc, argv);
   auto_ptr<test> ap1(new test);
   ap1->print();
   std::cout << "ap1 pointer: " << ap1.get() << std::endl;

   auto_ptr<test> ap2(ap1);
   ap2->print();
   std::cout << "ap1 pointer: " << ap1.get() << std::endl;
   std::cout << "ap2 pointer: " << ap2.get() << std::endl;


    return a.exec();
}
